package com.stars.services;

import com.stars.common.enums.JobOperateEnum;
import com.stars.entity.job.MyScheduleJobEntity;
import org.quartz.SchedulerException;

/**
 * Created by luodajie on 2019/10/12.
 */
public interface MyQuartzService {
    /**
     * 服务器启动执行定时任务
     *
     * @author lanjerry
     * @date 2019/1/28 15:38
     */
    void timingTask();
    /**
     * 新增定时任务
     *
     * @param myScheduleJobEntity 任务
     * @author lanjerry
     * @date 2019/1/28 15:44
     */
    void addJob(MyScheduleJobEntity myScheduleJobEntity);
    /**
     * 操作定时任务
     *
     * @param jobOperateEnum 操作枚举
     * @param myScheduleJobEntity            任务
     * @author lanjerry
     * @date 2019/1/28 16:56
     */
    void operateJob(JobOperateEnum jobOperateEnum, MyScheduleJobEntity myScheduleJobEntity) throws SchedulerException;
    /**
     * 启动所有任务
     *
     * @author lanjerry
     * @date 2019/1/28 16:58
     */
    void startAllJob() throws SchedulerException;
    /**
     * 暂停所有任务
     *
     * @author lanjerry
     * @date 2019/1/28 16:58
     */
    void pauseAllJob() throws SchedulerException;
}
